package utils;

import java.util.List;

public class Theater {

	// assumed unique for a country or region
	private String name;
	private List<Room> rooms;
	private Integer numTotalPlaces = 0;

	// location data
	private String country;
	private String city;
	private String address;
	private GPSData gpsData;

	// constructor
	public Theater(String name, List<Room> rooms, String country, String city,
			GPSData gps) {
		this.name = name;
		this.rooms = rooms;
		for (Room r : rooms)
			numTotalPlaces += r.getNumRows() * r.getNumCols();
		// location
		this.country = country;
		this.city = city;
		this.gpsData = gps;
	}

	public String getName() {
		return name;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String c) {
		country = c;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String c) {
		city = c;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String add) {
		address = add;
	}

	public GPSData getGPSData() {
		return gpsData;
	}

	public void setGPSData(GPSData gps) {
		gpsData = gps;
	}

	public List<Room> getRooms() {
		return rooms;
	}

	public void setRooms(List<Room> rooms) {
		this.rooms = rooms;
		// update total number of places
		numTotalPlaces = 0;
		for (Room r : rooms)
			numTotalPlaces += r.getNumRows() * r.getNumCols();
	}

	public Integer getTotalPlace() {
		return numTotalPlaces;
	}

	public void setName(String newName) {
		this.name = newName;
	}
}
